import 'package:http/http.dart' as http;

Future<http.Response> httpPost(
  String url,
  Map<String, String> headers,
  String body,
) async {
  var response = await http.post(
    Uri.parse(url),
    headers: headers,
    body: body,
  );
  if (response.statusCode < 400 && response.statusCode >= 300) {
    return httpPost(response.headers['location']!, headers, body);
  }
  return response;
}
